Run the published binary from the directory it was downloaded into - #225
Merged
Merged
Conversation
The smoke job resolved the downloaded binary from inside `download/` and wrote
that result into the environment file as `./lab_<tag>_<platform>`. The platform
starts every step in the workspace and a `cd` lives and dies with the step that
runs it, so the step that executes the binary read the name one directory too
high and the file was not there.
What makes it worth finding before a release rather than during one is what the
failure looks like when it happens. The run step treats any non-zero code as the
binary having refused the tree, so an artefact that was never executed at all
would have reddened all three matrix entries with a message about record 0011.
Reproduced by standing the two steps up as separate shells from a workspace
holding `download/lab_v0.0.1_linux_amd64`:
chmod: cannot access './lab_v0.0.1_linux_amd64': No such file or directory
code=127
With the path written relative to the workspace instead, the same reproduction
executes the binary against a fresh clone of this repository and every assertion
in that step passes:
code=0
examined fresh-clone
1 experiment directory walked, 1 record read
27 decision records read
0 refused
Nothing in this tree refuses the next one. Both legs of that workflow run on a
tag or on a published release, so their steps reach no pull request, and this
was found by reading the file rather than by a check.
Refs #43
Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #43.
What was wrong
.github/workflows/smoke.ymlresolved the downloaded binary from insidedownload/and handed the result on through the environment file:find .from inside that directory returns./lab_<tag>_<platform>. Theplatform starts every step in the workspace and a
cdlives and dies with thestep that runs it, so the step two below, which is where the binary is actually
executed, read that name one directory too high.
Why it is worth finding before a release rather than during one
The run step treats any non-zero code as the binary having refused the tree:
So an artefact that was never executed at all would have reddened all three
matrix entries with a message about record 0011, on the first real release, and
the reading it invites is that the published binary is broken.
The evidence
Both steps stood up as separate shells from a workspace holding
download/lab_v0.0.1_linux_amd64, which is how the platform runs them. Before:After, against a fresh clone of this repository made by the same reproduction:
The assertion block of that step, run verbatim over that log rather than
described:
The four legs of the gate on this branch:
gofmt -lprinted nothing, which is its passing result.The means
A one-line change to the workflow that already carries this job, because what
was wrong is a path this file computes and hands to itself. Nothing else could
carry it: the value never leaves that workflow, and moving it into the runner
would put a property of a step into a binary that knows nothing about steps.
What this does not do
It does not finish #43. The last leg of that issue's done-when is the job having
passed against a real release, and there is none:
So what is repaired here is a defect in a leg that cannot run yet, found by
reading the file rather than by running it. The bound is that the reproduction
above is two shells on this machine standing in for two steps on a runner: it
reproduces the working directory the platform gives each step and it reproduces
nothing else about one, and no run of this workflow has executed either leg.
The other job in that file,
verify the published artefacts, was read in thesame pass for the same class. Its three steps each
cd downloadfor themselvesand hand no path between them, so it does not carry this defect. That is a
reading rather than a run.
Nothing in this tree refuses the next one of these. Both legs of this workflow
run on a tag or on a published release, so their steps reach no pull request,
and no check here reads a shell path across steps.
Second reader
There is none tonight. The evidence above stands in place of one, and the
negative results in it are stated rather than softened.